home *** CD-ROM | disk | FTP | other *** search
/ Internet Tools (InfoMagic) / Internet Tools.iso / dos_win / winsock / hacklist / 94-04.Z / 94-04 / 000014_bruce@isi.FrontierTech.COM_Mon Apr 18 02:38:09 1994.msg < prev    next >
Internet Message Format  |  1994-04-30  |  2KB

  1. Received: from isi.FrontierTech.COM by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.07) with SMTP
  2.           id AA15970; Mon, 18 Apr 1994 09:37:54 -0400
  3. Received: from bruces.FrontierTech.COM by isi.FrontierTech.COM (5.65/1.40)
  4.     id AA07274; Mon, 18 Apr 94 08:37:18 -0500
  5. X-Mailer: SuperTCP/NFS for Windows Version 4.00 (Mailer Version 1.02)
  6. Message-Id: <2DB29B55-00000001@Bruces.FrontierTech.COM>
  7. From: Bruce@isi.FrontierTech.COM
  8. Date: Mon, 18 Apr 94 08:38:09 CST
  9. Subject: Re: Curious behaviour from winsock
  10. To: winsock-hackers@sunsite.unc.edu
  11. Mime-Version: 1.0
  12. Content-Type: Text/Plain; Charset=US-ASCII
  13.  
  14. Bob Quin writes: 
  15. >
  16. >I agree with your suggested method for the most robust way to
  17. >close a socket; that's what we recommend also.  But it's certainly 
  18. >reasonable to call closesocket() and expect an FD_CLOSE when the 
  19. >graceful close completes (e.g. FIN response received, so TIME_WAIT
  20. >state entered) or the graceful close attempt times out.
  21. >
  22. >For example, assuming your application initiated the close (called
  23. >closesocket() first), then you'd be in FIN_WAIT.  On page 91 in the
  24. >documentation for WSAAsyncSelect() the spec says "The FD_CLOSE is
  25. >posted when the connection goes into FIN_WAIT or CLOSE_WAIT states."
  26. >
  27. That same documentation says "Closing a socket with closesocket() also
  28. cancels WSAAsyncSelect() message sending" (p. 89).  I've always felt that
  29. once closesocket() is called, the descriptor is invalid, and a DLL
  30. shouldn't post  messages containing invalid descriptors.
  31.  
  32. The FD_CLOSE would be redundant, anyway, wouldn't it?  It was the
  33. application that initiated the close, so it should already know about it,
  34. right?
  35.  
  36. ****************************************
  37. Bruce A Backman (Bruce@FrontierTech.COM)
  38. Frontier Technologies Corporation
  39. 10201 North Port Washington Road
  40. Mequon,  WI  53092
  41. ****************************************